package com.carsite.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * 盘点表
 * 
 * @struts.form include-all="false" extends="BaseForm"
 * @hibernate.class table="WT_CheckTable"
 */
public class CheckTable extends BaseObject implements Serializable {
	private Long ctId;

	private Date dTime;// 盘点时间
	 

	private String deptName;// 仓库名

	private String person01_Name;// 复盘点人姓名

	private String person00_Name;// 初盘点人姓名

	private Set items = new HashSet();// 盘点明细

	/**
	 * @struts.form-field form-name="CheckTableForm"
	 * @hibernate.id column="ctId" generator-class="increment"
	 *               unsaved-value="null"
	 */
	public Long getCtId() {
		return ctId;
	}

	/**
	 * @struts.form-field form-name="CheckTableForm"
	 * @hibernate.property
	 */
	public String getDeptName() {
		return deptName;
	}

	/**
	 * @struts.form-field form-name="CheckTableForm"
	 * @hibernate.property
	 */
	public Date getDTime() {
		return dTime;
	}

	/**
	 * @hibernate.set name="items" cascade="delete-orphan" inverse="true"
	 *                lazy="false"
	 * @hibernate.one-to-many class="com.carsite.model.Item"
	 * @hibernate.collection-key column="checkTable_Id"
	 * 
	 */

	public Set getItems() {
		return items;
	}

	/**
	 * @struts.form-field form-name="CheckTableForm"
	 * @hibernate.property
	 */
	public String getPerson00_Name() {
		return person00_Name;
	}

	/**
	 * @struts.form-field form-name="CheckTableForm"
	 * @hibernate.property
	 */
	public String getPerson01_Name() {
		return person01_Name;
	}

	public void setCtId(Long ctId) {
		this.ctId = ctId;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public void setDTime(Date time) {
		dTime = time;
	}

	public void setItems(Set items) {
		this.items = items;
	}

	public void setPerson00_Name(String person00_Name) {
		this.person00_Name = person00_Name;
	}

	public void setPerson01_Name(String person01_Name) {
		this.person01_Name = person01_Name;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

	public void addItem(Item item) {
		items.add(item);
		// item.setOrder(this);
	}

	public String getTimeString() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		return sdf.format(this.getDTime());
	}

 
}
